# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.shortcuts import render
from django.views import generic
from advertisement.models import Advertisement
# Create your views here.


class HomeView(generic.TemplateView):
    
    template_name = 'index.html'

    def get_context_data(self, **kwargs):
        context = super(HomeView, self).get_context_data(**kwargs)
        adv_list = Advertisement.objects.filter(enable=True)
        context['advertisements'] = adv_list
        return context
